package com.huey.utils.design.structure.proxy.proxy;

/**
 * 测试
 * @author xubo
 * @date 2023/3/31 15:59
 */
public class StaticTest {

    ///静态代理测试类---多肽
/*    public static void main(String[] args) {
        //父到子
        SmsService smsService = new SmsServiceImpl();
        //传参，先拿父后拿子
        SmsProxy smsProxy = new SmsProxy(smsService);
        smsProxy.send("java");
    }*/

    //动态代理jdk
/*    public static void main(String[] args) {
        SmsService smsService = (SmsService) JdkProxyFactory.getProxy(new SmsServiceImpl());
        smsService.send("java");
    }*/

    //cglib
    public static void main(String[] args) {
        AliSmsService aliSmsService = (AliSmsService) CglibProxyFactory.getProxy(AliSmsService.class);
        aliSmsService.send("java");
    }


}
